﻿using UnityEngine;

public abstract class TutorialGameObject
{
    public abstract GameObject GetGameObject();
}

/// <summary>
/// 通过名字查找物体
/// </summary>
public class TutorialGameObject_Name : TutorialGameObject
{
    private string _name;

    public TutorialGameObject_Name(string name)
    {
        _name = name;
    }

    public override GameObject GetGameObject()
    {
        GameObject go = GameObject.Find(_name);
        if (go == null)
        {
            Debug.LogError($"[TutorialPosition] 找不到名字为{_name}的物体");
            return null;
        }
        return go;
    }
}